import java.util.Scanner;

//二、1、
public class _2_1 {
   public static boolean func(int num){
       for (int i =2;i<=Math.sqrt(num);i++){
           if(num%i==0){
               return false;
           }
       }

       return true;
   }

    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int num=in.nextInt();
        System.out.println(func(num));
    }
}
